import 'package:flutter/material.dart';
import 'package:ls_loading/Loading.dart';
import 'package:ls_loading/Type.dart';

class LoadingAnimation extends AnimatedWidget {
  final List<int> pointsArc;
  final LoadingStyle loadingStyle;
  LoadingAnimation(
      {required Animation<int> animation,
      required this.pointsArc,
      required this.loadingStyle})
      : super(listenable: animation);

  @override
  Widget build(BuildContext context) {
    final animation = listenable as Animation<int>;

    return CustomPaint(
      painter: LoadingPainter(
          index: animation.value,
          pointsArc: pointsArc,
          loadingStyle: loadingStyle),
    );
  }
}
